   1              		.syntax unified
   2              		.cpu cortex-m3
   3              		.fpu softvfp
   4              		.eabi_attribute 20, 1
   5              		.eabi_attribute 21, 1
   6              		.eabi_attribute 23, 3
   7              		.eabi_attribute 24, 1
   8              		.eabi_attribute 25, 1
   9              		.eabi_attribute 26, 1
  10              		.eabi_attribute 30, 4
  11              		.eabi_attribute 34, 1
  12              		.eabi_attribute 18, 4
  13              		.thumb
  14              		.syntax unified
  15              		.file	"crc.c"
  16              		.text
  17              	.Ltext0:
  18              		.cfi_sections	.debug_frame
  19              		.section	.text.crc16_Right,"ax",%progbits
  20              		.align	1
  21              		.thumb
  22              		.thumb_func
  24              	crc16_Right:
  25              	.LFB1:
  26              		.file 1 "uc_libc_dev/crc/crc.c"
   1:uc_libc_dev/crc/crc.c **** /*
   2:uc_libc_dev/crc/crc.c **** Atualizado em 17/03/2015
   3:uc_libc_dev/crc/crc.c **** 
   4:uc_libc_dev/crc/crc.c **** Autor Diego Fontana
   5:uc_libc_dev/crc/crc.c **** 
   6:uc_libc_dev/crc/crc.c **** leia-me
   7:uc_libc_dev/crc/crc.c **** 
   8:uc_libc_dev/crc/crc.c **** 	o calculo do CRC eh feito em cima dos polinomios, como por exemplo o
   9:uc_libc_dev/crc/crc.c **** MODBUS, ele utiliza o polinomio "X^16+X^15+X^2+X^0" que em hexa é 0x8005,
  10:uc_libc_dev/crc/crc.c **** as rotinas de calculos de CRC precisam de um valor inicial par ao CRC
  11:uc_libc_dev/crc/crc.c **** é do polinomio, o CRC é calculado em cima de cada BYTE do pacote.
  12:uc_libc_dev/crc/crc.c **** 
  13:uc_libc_dev/crc/crc.c **** 	Existem duas forma de calcular o CRC, uma rotacionando para diretira
  14:uc_libc_dev/crc/crc.c **** e outra para esquerda, aqui temos duas duas rotinas genéricas:
  15:uc_libc_dev/crc/crc.c **** 	crc16_Right: calcula o CRC de modo Rigth Shifted
  16:uc_libc_dev/crc/crc.c **** 	crc16_Left: calcula o CRC de modo Left Shifted
  17:uc_libc_dev/crc/crc.c **** 
  18:uc_libc_dev/crc/crc.c **** 	Por algum motivo que eu ainda nao sei, cada sistema utiliza sua proprio
  19:uc_libc_dev/crc/crc.c **** combinação de crc16_Right ou crc16_Left, polinomio e valor inicial.
  20:uc_libc_dev/crc/crc.c **** 
  21:uc_libc_dev/crc/crc.c **** 	O detalhe na rotina crc16_Right (Right Shifted) é que o polinomio utilizado
  22:uc_libc_dev/crc/crc.c **** deve estar espelhado, por exemplo o MODBUS utiliza o valor 0x8005, portando
  23:uc_libc_dev/crc/crc.c **** o polinomio real a ser calculado na rotina é 0xA001. Por isso a função crc16_Poly
  24:uc_libc_dev/crc/crc.c **** faz o espelhamento do polinomio, ajustando para o uso correto.
  25:uc_libc_dev/crc/crc.c **** 
  26:uc_libc_dev/crc/crc.c **** 	O calculo do CRC para DNP3 é um pouco mais estranho, se for avaliado
  27:uc_libc_dev/crc/crc.c **** o CRC de byte a byte ele fecha com a tabela encontrada neste site
  28:uc_libc_dev/crc/crc.c **** http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_11722859.html
  29:uc_libc_dev/crc/crc.c **** mas o valor final utilizado deve ser aplicado complemento "~" e os BYTES da word
  30:uc_libc_dev/crc/crc.c **** estão com os valores ALTO e BAIXO trocados.
  31:uc_libc_dev/crc/crc.c **** 
  32:uc_libc_dev/crc/crc.c **** 	[REFERENCIAS]
  33:uc_libc_dev/crc/crc.c **** 
  34:uc_libc_dev/crc/crc.c **** 	http://en.wikipedia.org/wiki/Cyclic_redundancy_check
  35:uc_libc_dev/crc/crc.c **** 	http://www.lammertbies.nl/comm/info/crc-calculation.html
  36:uc_libc_dev/crc/crc.c **** 	http://ghsi.de/CRC/
  37:uc_libc_dev/crc/crc.c **** 
  38:uc_libc_dev/crc/crc.c **** */
  39:uc_libc_dev/crc/crc.c **** 
  40:uc_libc_dev/crc/crc.c **** #include "crc.h"
  41:uc_libc_dev/crc/crc.c **** 
  42:uc_libc_dev/crc/crc.c **** static u16 crc16_Poly(u16 poly);
  43:uc_libc_dev/crc/crc.c **** static u16 crc16_Right(void* data, int length, u16 poly, u16 init);
  44:uc_libc_dev/crc/crc.c **** static u16 crc16_Left(void* data, int length, u16 poly, u16 init);
  45:uc_libc_dev/crc/crc.c **** 
  46:uc_libc_dev/crc/crc.c **** //cria espelho do polinomio
  47:uc_libc_dev/crc/crc.c **** static u16 crc16_Poly (u16 poly) {
  48:uc_libc_dev/crc/crc.c ****     u16 i, r = 0;
  49:uc_libc_dev/crc/crc.c ****     for (i=0;i<16;i++) {
  50:uc_libc_dev/crc/crc.c ****         r = r << 1;
  51:uc_libc_dev/crc/crc.c ****         r = r | (poly&1);
  52:uc_libc_dev/crc/crc.c ****         poly = poly >> 1;
  53:uc_libc_dev/crc/crc.c ****     }
  54:uc_libc_dev/crc/crc.c ****     return r;
  55:uc_libc_dev/crc/crc.c **** }
  56:uc_libc_dev/crc/crc.c **** 
  57:uc_libc_dev/crc/crc.c **** //16bits CRC right shifted
  58:uc_libc_dev/crc/crc.c **** //data = buffer de bytes a serem calculados
  59:uc_libc_dev/crc/crc.c **** //length = quantidade de bytes
  60:uc_libc_dev/crc/crc.c **** //poly = polinomio original
  61:uc_libc_dev/crc/crc.c **** //init = valor inicial do crc
  62:uc_libc_dev/crc/crc.c **** static u16 crc16_Right(void* data, int length, u16 poly, u16 init) {
  27              		.loc 1 62 0
  28              		.cfi_startproc
  29              		@ args = 0, pretend = 0, frame = 0
  30              		@ frame_needed = 0, uses_anonymous_args = 0
  31              	.LVL0:
  32 0000 70B5     		push	{r4, r5, r6, lr}
  33              	.LCFI0:
  34              		.cfi_def_cfa_offset 16
  35              		.cfi_offset 4, -16
  36              		.cfi_offset 5, -12
  37              		.cfi_offset 6, -8
  38              		.cfi_offset 14, -4
  39              		.loc 1 62 0
  40 0002 1025     		movs	r5, #16
  41              	.LBB4:
  42              	.LBB5:
  48:uc_libc_dev/crc/crc.c ****     for (i=0;i<16;i++) {
  43              		.loc 1 48 0
  44 0004 0024     		movs	r4, #0
  45              	.LVL1:
  46              	.L2:
  51:uc_libc_dev/crc/crc.c ****         poly = poly >> 1;
  47              		.loc 1 51 0
  48 0006 02F00106 		and	r6, r2, #1
  49 000a 013D     		subs	r5, r5, #1
  50              	.LVL2:
  51 000c 46EA4404 		orr	r4, r6, r4, lsl #1
  52              	.LVL3:
  53 0010 ADB2     		uxth	r5, r5
  54 0012 A4B2     		uxth	r4, r4
  55              	.LVL4:
  52:uc_libc_dev/crc/crc.c ****     }
  56              		.loc 1 52 0
  57 0014 5208     		lsrs	r2, r2, #1
  58              	.LVL5:
  49:uc_libc_dev/crc/crc.c ****         r = r << 1;
  59              		.loc 1 49 0
  60 0016 002D     		cmp	r5, #0
  61 0018 F5D1     		bne	.L2
  62 001a 0144     		add	r1, r1, r0
  63              	.LVL6:
  64              	.L3:
  65              	.LBE5:
  66              	.LBE4:
  63:uc_libc_dev/crc/crc.c **** 	u16 i, crc = init;
  64:uc_libc_dev/crc/crc.c **** 	u8 * p = data;
  65:uc_libc_dev/crc/crc.c **** 	poly = crc16_Poly(poly);
  66:uc_libc_dev/crc/crc.c **** 	while (length--) {
  67              		.loc 1 66 0
  68 001c 8842     		cmp	r0, r1
  69 001e 10D0     		beq	.L11
  67:uc_libc_dev/crc/crc.c **** 		crc = crc ^ (*p++);
  70              		.loc 1 67 0
  71 0020 10F8012B 		ldrb	r2, [r0], #1	@ zero_extendqisi2
  72              	.LVL7:
  73 0024 5340     		eors	r3, r3, r2
  74              	.LVL8:
  75 0026 0822     		movs	r2, #8
  76              	.LVL9:
  77              	.L6:
  68:uc_libc_dev/crc/crc.c **** 		for (i = 0; i < 8; i++)
  69:uc_libc_dev/crc/crc.c **** 			crc = (crc & 0x0001) ? (crc >> 1) ^ poly : (crc >> 1);
  78              		.loc 1 69 0
  79 0028 13F0010F 		tst	r3, #1
  80 002c 02F1FF32 		add	r2, r2, #-1
  81              	.LVL10:
  82 0030 4FEA5303 		lsr	r3, r3, #1
  83              	.LVL11:
  84 0034 9BB2     		uxth	r3, r3
  85 0036 92B2     		uxth	r2, r2
  86 0038 18BF     		it	ne
  87 003a 6340     		eorne	r3, r3, r4
  88              	.LVL12:
  68:uc_libc_dev/crc/crc.c **** 		for (i = 0; i < 8; i++)
  89              		.loc 1 68 0
  90 003c 002A     		cmp	r2, #0
  91 003e F3D1     		bne	.L6
  92 0040 ECE7     		b	.L3
  93              	.LVL13:
  94              	.L11:
  70:uc_libc_dev/crc/crc.c **** 	}
  71:uc_libc_dev/crc/crc.c **** 	return crc;
  72:uc_libc_dev/crc/crc.c **** }
  95              		.loc 1 72 0
  96 0042 1846     		mov	r0, r3
  97              	.LVL14:
  98 0044 70BD     		pop	{r4, r5, r6, pc}
  99              		.cfi_endproc
 100              	.LFE1:
 102              		.section	.text.crc16_NBR14522,"ax",%progbits
 103              		.align	1
 104              		.global	crc16_NBR14522
 105              		.thumb
 106              		.thumb_func
 108              	crc16_NBR14522:
 109              	.LFB3:
  73:uc_libc_dev/crc/crc.c **** 
  74:uc_libc_dev/crc/crc.c **** //16bits CRC left shifted
  75:uc_libc_dev/crc/crc.c **** //data = buffer de bytes a serem calculados
  76:uc_libc_dev/crc/crc.c **** //length = quantidade de bytes
  77:uc_libc_dev/crc/crc.c **** //poly = polinomio original
  78:uc_libc_dev/crc/crc.c **** //init = valor inicial do crc
  79:uc_libc_dev/crc/crc.c **** static u16 crc16_Left(void* data, int length, u16 poly, u16 init) {
  80:uc_libc_dev/crc/crc.c **** 	u16 i, crc = init;
  81:uc_libc_dev/crc/crc.c **** 	u8 * p = data;
  82:uc_libc_dev/crc/crc.c **** 	while (length--) {
  83:uc_libc_dev/crc/crc.c **** 		crc = crc ^ (*p++<<8);
  84:uc_libc_dev/crc/crc.c **** 		for (i = 0; i < 8; i++)
  85:uc_libc_dev/crc/crc.c **** 			crc = (crc & 0x8000) ? (crc << 1) ^ poly : (crc << 1);
  86:uc_libc_dev/crc/crc.c **** 	}
  87:uc_libc_dev/crc/crc.c **** 	return crc;
  88:uc_libc_dev/crc/crc.c **** }
  89:uc_libc_dev/crc/crc.c **** 
  90:uc_libc_dev/crc/crc.c **** //---------------------------------------------------------------------
  91:uc_libc_dev/crc/crc.c **** // CRC: aplicações práticas
  92:uc_libc_dev/crc/crc.c **** //---------------------------------------------------------------------
  93:uc_libc_dev/crc/crc.c **** 
  94:uc_libc_dev/crc/crc.c **** //poly = x16 + x15 + x2 + x0 = 0x8005
  95:uc_libc_dev/crc/crc.c **** u16 crc16_NBR14522(void* data, int length) {
 110              		.loc 1 95 0
 111              		.cfi_startproc
 112              		@ args = 0, pretend = 0, frame = 0
 113              		@ frame_needed = 0, uses_anonymous_args = 0
 114              		@ link register save eliminated.
 115              	.LVL15:
  96:uc_libc_dev/crc/crc.c **** 	return crc16_Right(data, length, 0x8005, 0x0000);
 116              		.loc 1 96 0
 117 0000 0023     		movs	r3, #0
 118 0002 48F20502 		movw	r2, #32773
 119 0006 FFF7FEBF 		b	crc16_Right
 120              	.LVL16:
 121              		.cfi_endproc
 122              	.LFE3:
 124              		.section	.text.crc16_MODBUS,"ax",%progbits
 125              		.align	1
 126              		.global	crc16_MODBUS
 127              		.thumb
 128              		.thumb_func
 130              	crc16_MODBUS:
 131              	.LFB4:
  97:uc_libc_dev/crc/crc.c **** }
  98:uc_libc_dev/crc/crc.c **** 
  99:uc_libc_dev/crc/crc.c **** //poly = x16 + x15 + x2 + x0 = 0x8005
 100:uc_libc_dev/crc/crc.c **** u16 crc16_MODBUS(void* data, int length) {
 132              		.loc 1 100 0
 133              		.cfi_startproc
 134              		@ args = 0, pretend = 0, frame = 0
 135              		@ frame_needed = 0, uses_anonymous_args = 0
 136              		@ link register save eliminated.
 137              	.LVL17:
 101:uc_libc_dev/crc/crc.c **** 	return crc16_Right( data, length, 0x8005, 0xFFFF );
 138              		.loc 1 101 0
 139 0000 4FF6FF73 		movw	r3, #65535
 140 0004 48F20502 		movw	r2, #32773
 141 0008 FFF7FEBF 		b	crc16_Right
 142              	.LVL18:
 143              		.cfi_endproc
 144              	.LFE4:
 146              		.section	.text.crc16_XMODEM,"ax",%progbits
 147              		.align	1
 148              		.global	crc16_XMODEM
 149              		.thumb
 150              		.thumb_func
 152              	crc16_XMODEM:
 153              	.LFB5:
 102:uc_libc_dev/crc/crc.c **** }
 103:uc_libc_dev/crc/crc.c **** 
 104:uc_libc_dev/crc/crc.c **** //poly = x16 + x12 + x5 + x0 = 0x1021
 105:uc_libc_dev/crc/crc.c **** u16 crc16_XMODEM(void* data, int length) {
 154              		.loc 1 105 0
 155              		.cfi_startproc
 156              		@ args = 0, pretend = 0, frame = 0
 157              		@ frame_needed = 0, uses_anonymous_args = 0
 158              	.LVL19:
 159 0000 10B5     		push	{r4, lr}
 160              	.LCFI1:
 161              		.cfi_def_cfa_offset 8
 162              		.cfi_offset 4, -8
 163              		.cfi_offset 14, -4
 164 0002 0144     		add	r1, r1, r0
 165              	.LVL20:
 166              		.loc 1 105 0
 167 0004 0446     		mov	r4, r0
 168              	.LVL21:
 169              	.LBB8:
 170              	.LBB9:
  80:uc_libc_dev/crc/crc.c **** 	u8 * p = data;
 171              		.loc 1 80 0
 172 0006 0020     		movs	r0, #0
 173              	.LVL22:
 174              	.L15:
  82:uc_libc_dev/crc/crc.c **** 		crc = crc ^ (*p++<<8);
 175              		.loc 1 82 0
 176 0008 8C42     		cmp	r4, r1
 177 000a 15D0     		beq	.L21
  83:uc_libc_dev/crc/crc.c **** 		for (i = 0; i < 8; i++)
 178              		.loc 1 83 0
 179 000c 14F8013B 		ldrb	r3, [r4], #1	@ zero_extendqisi2
 180              	.LVL23:
 181 0010 0822     		movs	r2, #8
 182 0012 80EA0320 		eor	r0, r0, r3, lsl #8
 183              	.LVL24:
 184              	.L18:
  85:uc_libc_dev/crc/crc.c **** 	}
 185              		.loc 1 85 0
 186 0016 10F4004F 		tst	r0, #32768
 187 001a 4FEA4003 		lsl	r3, r0, #1
 188 001e 18BF     		it	ne
 189 0020 83F48153 		eorne	r3, r3, #4128
 190 0024 02F1FF32 		add	r2, r2, #-1
 191              	.LVL25:
 192 0028 18BF     		it	ne
 193 002a 83F00103 		eorne	r3, r3, #1
 194 002e 92B2     		uxth	r2, r2
 195 0030 98B2     		uxth	r0, r3
 196              	.LVL26:
  84:uc_libc_dev/crc/crc.c **** 			crc = (crc & 0x8000) ? (crc << 1) ^ poly : (crc << 1);
 197              		.loc 1 84 0
 198 0032 002A     		cmp	r2, #0
 199 0034 EFD1     		bne	.L18
 200 0036 E7E7     		b	.L15
 201              	.LVL27:
 202              	.L21:
 203              	.LBE9:
 204              	.LBE8:
 106:uc_libc_dev/crc/crc.c **** 	return crc16_Left(data, length, 0x1021, 0x0000 );
 107:uc_libc_dev/crc/crc.c **** }
 205              		.loc 1 107 0
 206 0038 10BD     		pop	{r4, pc}
 207              		.cfi_endproc
 208              	.LFE5:
 210              		.section	.text.crc16_DNP3,"ax",%progbits
 211              		.align	1
 212              		.global	crc16_DNP3
 213              		.thumb
 214              		.thumb_func
 216              	crc16_DNP3:
 217              	.LFB6:
 108:uc_libc_dev/crc/crc.c **** 
 109:uc_libc_dev/crc/crc.c **** //poly = x16 + x13 + x12 + x11 + x10 + x8 + x6 + x5 + x2 + x0  = 0x3D65
 110:uc_libc_dev/crc/crc.c **** u16 crc16_DNP3(void* data, int length) {
 218              		.loc 1 110 0
 219              		.cfi_startproc
 220              		@ args = 0, pretend = 0, frame = 0
 221              		@ frame_needed = 0, uses_anonymous_args = 0
 222              	.LVL28:
 223 0000 08B5     		push	{r3, lr}
 224              	.LCFI2:
 225              		.cfi_def_cfa_offset 8
 226              		.cfi_offset 3, -8
 227              		.cfi_offset 14, -4
 111:uc_libc_dev/crc/crc.c **** 	//calcula e depois aplica o complemento
 112:uc_libc_dev/crc/crc.c ****     u16 r = ~crc16_Right(data, length, 0x3D65, 0x0000 );
 228              		.loc 1 112 0
 229 0002 43F66552 		movw	r2, #15717
 230 0006 0023     		movs	r3, #0
 231 0008 FFF7FEFF 		bl	crc16_Right
 232              	.LVL29:
 113:uc_libc_dev/crc/crc.c ****     //troca os bytes
 114:uc_libc_dev/crc/crc.c ****     return (r>>8)|(r<<8);
 233              		.loc 1 114 0
 234 000c C043     		mvns	r0, r0
 235              	.LVL30:
 236 000e 40BA     		rev16	r0, r0
 115:uc_libc_dev/crc/crc.c **** }
 237              		.loc 1 115 0
 238 0010 80B2     		uxth	r0, r0
 239 0012 08BD     		pop	{r3, pc}
 240              		.cfi_endproc
 241              	.LFE6:
 243              		.section	.text.crc7,"ax",%progbits
 244              		.align	1
 245              		.global	crc7
 246              		.thumb
 247              		.thumb_func
 249              	crc7:
 250              	.LFB7:
 116:uc_libc_dev/crc/crc.c **** 
 117:uc_libc_dev/crc/crc.c **** //texe(33F): 350us/100bytes [data 18.01.12]
 118:uc_libc_dev/crc/crc.c **** //texe(32MX): 137us/100bytes [data 24.01.12]
 119:uc_libc_dev/crc/crc.c **** //X^7+X^3+X^0 = 0x09
 120:uc_libc_dev/crc/crc.c **** u8 crc7(void* data, int length) {
 251              		.loc 1 120 0
 252              		.cfi_startproc
 253              		@ args = 0, pretend = 0, frame = 0
 254              		@ frame_needed = 0, uses_anonymous_args = 0
 255              	.LVL31:
 256 0000 30B5     		push	{r4, r5, lr}
 257              	.LCFI3:
 258              		.cfi_def_cfa_offset 12
 259              		.cfi_offset 4, -12
 260              		.cfi_offset 5, -8
 261              		.cfi_offset 14, -4
 262 0002 0144     		add	r1, r1, r0
 263              	.LVL32:
 121:uc_libc_dev/crc/crc.c **** 	u8 i, c;
 122:uc_libc_dev/crc/crc.c **** 	u8 crc;
 123:uc_libc_dev/crc/crc.c **** 	u8 * p = data;
 124:uc_libc_dev/crc/crc.c **** 	crc = 0x00;
 264              		.loc 1 124 0
 265 0004 0023     		movs	r3, #0
 266              	.LVL33:
 267              	.L24:
 125:uc_libc_dev/crc/crc.c **** 	while (length--) {
 268              		.loc 1 125 0
 269 0006 8842     		cmp	r0, r1
 270 0008 14D0     		beq	.L29
 126:uc_libc_dev/crc/crc.c **** 		c = *p++;
 271              		.loc 1 126 0
 272 000a 10F8014B 		ldrb	r4, [r0], #1	@ zero_extendqisi2
 273              	.LVL34:
 274 000e 0822     		movs	r2, #8
 275              	.LVL35:
 276              	.L26:
 127:uc_libc_dev/crc/crc.c **** 		for (i = 0; i < 8; i++) {
 128:uc_libc_dev/crc/crc.c **** 			crc = crc << 1;
 277              		.loc 1 128 0
 278 0010 5B00     		lsls	r3, r3, #1
 279              	.LVL36:
 280 0012 DBB2     		uxtb	r3, r3
 281              	.LVL37:
 129:uc_libc_dev/crc/crc.c **** 			if ((c ^ crc) & 0x80) crc = crc ^ 0x09;
 282              		.loc 1 129 0
 283 0014 83EA0405 		eor	r5, r3, r4
 284 0018 2D06     		lsls	r5, r5, #24
 285 001a 02F1FF32 		add	r2, r2, #-1
 286              	.LVL38:
 287 001e 48BF     		it	mi
 288 0020 83F00903 		eormi	r3, r3, #9
 289              	.LVL39:
 130:uc_libc_dev/crc/crc.c **** 			c = c << 1;
 290              		.loc 1 130 0
 291 0024 6400     		lsls	r4, r4, #1
 292              	.LVL40:
 127:uc_libc_dev/crc/crc.c **** 		for (i = 0; i < 8; i++) {
 293              		.loc 1 127 0
 294 0026 12F0FF02 		ands	r2, r2, #255
 295              		.loc 1 130 0
 296 002a E4B2     		uxtb	r4, r4
 297              	.LVL41:
 127:uc_libc_dev/crc/crc.c **** 		for (i = 0; i < 8; i++) {
 298              		.loc 1 127 0
 299 002c F0D1     		bne	.L26
 131:uc_libc_dev/crc/crc.c **** 		}
 132:uc_libc_dev/crc/crc.c **** 		crc = crc & 0x7F;
 300              		.loc 1 132 0
 301 002e 03F07F03 		and	r3, r3, #127
 302              	.LVL42:
 303 0032 E8E7     		b	.L24
 304              	.LVL43:
 305              	.L29:
 133:uc_libc_dev/crc/crc.c **** 	}
 134:uc_libc_dev/crc/crc.c **** 	return crc * 2 + 1;
 306              		.loc 1 134 0
 307 0034 5800     		lsls	r0, r3, #1
 308              	.LVL44:
 309 0036 0130     		adds	r0, r0, #1
 135:uc_libc_dev/crc/crc.c **** }
 310              		.loc 1 135 0
 311 0038 C0B2     		uxtb	r0, r0
 312 003a 30BD     		pop	{r4, r5, pc}
 313              		.cfi_endproc
 314              	.LFE7:
 316              		.section	.text.crc8_HEX,"ax",%progbits
 317              		.align	1
 318              		.global	crc8_HEX
 319              		.thumb
 320              		.thumb_func
 322              	crc8_HEX:
 323              	.LFB8:
 136:uc_libc_dev/crc/crc.c **** 
 137:uc_libc_dev/crc/crc.c **** 
 138:uc_libc_dev/crc/crc.c **** //padrão de checksum de arquivos tipo "intel hex"
 139:uc_libc_dev/crc/crc.c **** u8 crc8_HEX(void* data, int length) {
 324              		.loc 1 139 0
 325              		.cfi_startproc
 326              		@ args = 0, pretend = 0, frame = 0
 327              		@ frame_needed = 0, uses_anonymous_args = 0
 328              		@ link register save eliminated.
 329              	.LVL45:
 330 0000 0144     		add	r1, r1, r0
 331              	.LVL46:
 140:uc_libc_dev/crc/crc.c **** 	u8 r = 0;
 332              		.loc 1 140 0
 333 0002 0023     		movs	r3, #0
 334              	.LVL47:
 335              	.L31:
 141:uc_libc_dev/crc/crc.c **** 	u8 * p = data;
 142:uc_libc_dev/crc/crc.c **** 	while (length--) r += *p++;
 336              		.loc 1 142 0 discriminator 1
 337 0004 8842     		cmp	r0, r1
 338 0006 04D0     		beq	.L33
 339              		.loc 1 142 0 is_stmt 0 discriminator 2
 340 0008 10F8012B 		ldrb	r2, [r0], #1	@ zero_extendqisi2
 341              	.LVL48:
 342 000c 1344     		add	r3, r3, r2
 343              	.LVL49:
 344 000e DBB2     		uxtb	r3, r3
 345              	.LVL50:
 346 0010 F8E7     		b	.L31
 347              	.LVL51:
 348              	.L33:
 143:uc_libc_dev/crc/crc.c **** 	return -r;
 349              		.loc 1 143 0 is_stmt 1
 350 0012 5842     		negs	r0, r3
 351              	.LVL52:
 144:uc_libc_dev/crc/crc.c **** }
 352              		.loc 1 144 0
 353 0014 C0B2     		uxtb	r0, r0
 354 0016 7047     		bx	lr
 355              		.cfi_endproc
 356              	.LFE8:
 358              		.text
 359              	.Letext0:
 360              		.file 2 "uc_libc_dev/_libdef/uc_libdefs.h"
DEFINED SYMBOLS
                            *ABS*:00000000 crc.c
D:\_temp\_windows\cc9jCBw6.s:20     .text.crc16_Right:00000000 $t
D:\_temp\_windows\cc9jCBw6.s:24     .text.crc16_Right:00000000 crc16_Right
D:\_temp\_windows\cc9jCBw6.s:103    .text.crc16_NBR14522:00000000 $t
D:\_temp\_windows\cc9jCBw6.s:108    .text.crc16_NBR14522:00000000 crc16_NBR14522
D:\_temp\_windows\cc9jCBw6.s:125    .text.crc16_MODBUS:00000000 $t
D:\_temp\_windows\cc9jCBw6.s:130    .text.crc16_MODBUS:00000000 crc16_MODBUS
D:\_temp\_windows\cc9jCBw6.s:147    .text.crc16_XMODEM:00000000 $t
D:\_temp\_windows\cc9jCBw6.s:152    .text.crc16_XMODEM:00000000 crc16_XMODEM
D:\_temp\_windows\cc9jCBw6.s:211    .text.crc16_DNP3:00000000 $t
D:\_temp\_windows\cc9jCBw6.s:216    .text.crc16_DNP3:00000000 crc16_DNP3
D:\_temp\_windows\cc9jCBw6.s:244    .text.crc7:00000000 $t
D:\_temp\_windows\cc9jCBw6.s:249    .text.crc7:00000000 crc7
D:\_temp\_windows\cc9jCBw6.s:317    .text.crc8_HEX:00000000 $t
D:\_temp\_windows\cc9jCBw6.s:322    .text.crc8_HEX:00000000 crc8_HEX
                     .debug_frame:00000010 $d

NO UNDEFINED SYMBOLS
